import React from 'react';
import {Link} from 'react-router';
import {observer} from 'mobx-react';
import Im from 'immutable';
import {toJS} from 'mobx';

import Store from './store.js';
import './index.less';
import {CopyToClipboard} from 'react-copy-to-clipboard';

//component
import QRCode from 'qrcode.react';
import ReAvatar from 'components/widgets/ReAvatar';
import ReButton from 'components/widgets/ReButton';
import ReIcon from 'components/widgets/ReIcon';
import ReTextField from 'components/widgets/ReTextField';
import ReInfoText from 'components/widgets/ReInfoText';
import ReSelectField from 'components/widgets/ReSelectField';
import CountryCodeSelect from 'components/widgets/CountryCodeSelect';

@observer
export default class view extends React.Component {
    static propTypes = {
        //name: React.PropTypes.string,
    };

    static defaultProps = {};

    name = 'UsersEdit';
    store = null;

    constructor(props, context) {

        super(props, context);

        this.name = props.name ? props.name : this.name;
        this.store = new Store({name: this.name});
        let list = ['艺术家', '设计师', '少儿'];
        this.identityList = [];
        for (let i = 0; i < list.length; i++) {
            this.identityList.push({value: list[i], label: list[i]});
        }
        let list1 = ['画廊', '美术馆', '教育机构', '设计机构'];
        this.identity1List = [];
        for (let i = 0; i < list1.length; i++) {
            this.identity1List.push({value: list1[i], label: list1[i]});
        }
        this.labelList = [
            {type: 1, label: '艺术家', value: '艺术家',},
            {type: 1, label: '少儿', value: '少儿',},
            {type: 1, label: '设计师', value: '设计师',},
            {type: 4, label: '收藏家', value: '收藏家',},
            {type: 2, label: '美术馆', value: '美术馆',},
            {type: 2, label: '教育机构', value: '教育机构',},
            {type: 2, label: '画廊', value: '画廊',},
            {type: 2, label: '设计机构', value: '设计机构',},
        ]


    }

    componentWillMount() {
        this.store.will();
    }

    componentDidMount() {
        this.store.mount();
    }

    componentWillUnmount() {
        this.store.remove();
    }

    componentWillReact() {
        // console.log(arguments);
    }

    render() {
        let prefix = global.window.location.origin.indexOf('manage-test') > -1 ? 'https://staging.artivr.com' : 'https://www.artivr.com';
        return (
            <div className="orin-s-usersedit-root">
                <div className={this.store.visible ? 'usersedit-dialog show' : 'usersedit-dialog hide'}>
                    <div className="usersedit-wrap" onClick={(e) => this.store.closeDialog(e)}>
                        <div className="usersedit-box"
                             onClick={(e) => e.stopPropagation()}>
                            {
                                this.store.display === 'edit' ?
                                    <div className="main-contain">
                                        <div className="personalInfo-wrapper">
                                            <div className="header-wrapper">
                                                <p className="title">个人资料</p>
                                            </div>
                                            <div className="personalInfo-content">
                                                <div className="user-info-detail">
                                                    <div className="user-info-top">
                                                        <div className="user-info-avatar">
                                                            <ReAvatar
                                                                src={$$.utils.pictureThumb(this.store.cover, false)}
                                                                size={300}
                                                                className="avatar-image"/>
                                                            <p className="change-avatar-btn">
                                                                <span>{$$.LN.CHANGE_AVATAR}</span>
                                                                <input type='file' ref="avatarFile"
                                                                       onChange={(e) => this.store.filesOnChange(e, this.refs.avatarFile)}
                                                                       accept="image/jpg,image/png,image/jpeg"/>
                                                            </p>
                                                        </div>
                                                        <div className="user-info-right">
                                                            <div className="detail-form">
                                                                <div className="detail-item-wrapper">
                                                                    <div className="detail-item-line2">
                                                                        <span className="label">{'姓名'}</span>
                                                                        <ReTextField
                                                                            label=""
                                                                            isLabel={false}
                                                                            type="text"
                                                                            className="name-input"
                                                                            // tipLeft={true}
                                                                            CN={true}
                                                                            maxLength="20"
                                                                            notfullWidth={false}
                                                                            closeIcon={true}
                                                                            onChange={(e, v) => this.store.inputNickName(v)}
                                                                            onBlur={(e, v) => this.store.nickNameBlur()}
                                                                            // errorText={this.store.nickNameError}
                                                                            value={this.store.nickName}
                                                                            placeholder={$$.LN.NICK_NAME_HINT_TEXT}/>
                                                                    </div>
                                                                    <div className="detail-item-line2">
                                                                        <span className="label">{'类型'}</span>
                                                                        {
                                                                            this.store.type === 4 ?
                                                                                <div className="mobile-wechat-wrapper">
                                                                                    <p className="text">
                                                                                        <span>{'收藏家'}</span>
                                                                                    </p>
                                                                                </div>
                                                                                :
                                                                                <ReSelectField
                                                                                    type=""
                                                                                    className="identity-input"
                                                                                    isOpen={false}
                                                                                    list={this.store.type === 1 ?
                                                                                        this.identityList : this.identity1List}
                                                                                    // list={this.labelList}
                                                                                    value={this.store.label}
                                                                                    placeholder={'请选择类型'}
                                                                                    onChange={(v) => this.store.identityChange(v.value)}/>
                                                                        }
                                                                    </div>
                                                                </div>
                                                                <div className="detail-item-wrapper">
                                                                    <div className="detail-item-line2">
                                                                        <span className="label">手机号码</span>
                                                                        <div className="mobile-wechat-wrapper">
                                                                            <p className="text">
                                                                                <span>{this.store.phone}</span>
                                                                            </p>
                                                                            {/*<span*/}
                                                                            {/*onClick={() => this.store.openSignForm('MODIFY_MOBILE')}*/}
                                                                            {/*className="modify-bind">{'更换手机号'}</span>*/}
                                                                        </div>
                                                                    </div>
                                                                    <div className="detail-item-line2">
                                                                        <span className="label">微信</span>
                                                                        <div className="mobile-wechat-wrapper">
                                                                            <p className={'text gray'}>
                                                                                <span>{this.store.weChatName || '微信名称'}</span>
                                                                            </p>
                                                                            {
                                                                                this.store.weChatName &&
                                                                                <span className="modify-bind"
                                                                                      onClick={() => this.store.unbindWeixin()}>解绑微信</span>
                                                                            }
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div className="detail-item-wrapper">
                                                                    <span className="label">地区</span>
                                                                    <div className="region-input-wrapper">
                                                                        <ReTextField
                                                                            label=""
                                                                            isLabel={false}
                                                                            type="text"
                                                                            className="region-input"
                                                                            // tipLeft={true}
                                                                            CN={true}
                                                                            maxLength="20"
                                                                            notfullWidth={false}
                                                                            onChange={(e, v) => this.store.countryChange(v)}
                                                                            value={this.store.countries}
                                                                            placeholder={'国家'}/>
                                                                        <ReTextField
                                                                            label=""
                                                                            isLabel={false}
                                                                            type="text"
                                                                            className="region-input"
                                                                            // tipLeft={true}
                                                                            CN={true}
                                                                            maxLength="20"
                                                                            notfullWidth={false}
                                                                            onChange={(e, v) => this.store.provinceChange(v)}
                                                                            value={this.store.provinces}
                                                                            placeholder={'省份'}/>
                                                                        <ReTextField
                                                                            label=""
                                                                            isLabel={false}
                                                                            type="text"
                                                                            className="region-input"
                                                                            CN={true}
                                                                            maxLength="20"
                                                                            notfullWidth={false}
                                                                            onChange={(e, v) => this.store.cityChange(v)}
                                                                            value={this.store.city}
                                                                            placeholder={'城市'}/>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div className="user-info-bottom">
                                                        <div className="introduce-wrapper">
                                                            <span className="label">个人公开页网址</span>
                                                            <div className="personal-url-wrapper">
                                                                <ReTextField
                                                                    isLabel={false}
                                                                    type="text"
                                                                    className="email-input personal-url"
                                                                    notfullWidth={false}
                                                                    maxLength="40"
                                                                    supportEnOnly={false}
                                                                    prefixText={prefix + '/'}
                                                                    onChange={(e, v) => this.store.personalUrlChange(v)}
                                                                    onBlur={(e, v) => this.store.personalUrlBlur()}
                                                                    errorText={''}
                                                                    value={this.store.personalityUrl}>
                                                                </ReTextField>
                                                                <CopyToClipboard id="copy"
                                                                                 text={prefix + '/' + this.store.personalityUrl}>
                                                                    {
                                                                        !!this.store.personalityUrl ?
                                                                            <span
                                                                                onClick={() => this.store.copySuccess()}
                                                                                className="copy">{'复制'}</span>
                                                                            :
                                                                            <span></span>
                                                                    }
                                                                </CopyToClipboard>

                                                            </div>
                                                        </div>
                                                        <div className="introduce-wrapper">
                                                            <span className="label">个人描述</span>
                                                            <ReTextField
                                                                isLabel={false}
                                                                type="text"
                                                                className="introduce-input"
                                                                notfullWidth={false}
                                                                isTextarea={true}
                                                                maxLength="200"
                                                                placeholder={$$.LN.PERSONAL_SIGNATURE_HINT_TEXT}
                                                                label=""
                                                                CN={true}
                                                                // closeIcon={true}
                                                                onChange={(e, v) => this.store.inputIntroduce(v)}
                                                                // onBlur={(e, v) => this.store.introduceBlur()}
                                                                errorText={''}
                                                                value={this.store.introduce}>
                                                                <p className="value-length">
                                                                    {this.store.introduce.length > 200 ? 200 : this.store.introduce.length}/200
                                                                </p>
                                                            </ReTextField>
                                                        </div>
                                                    </div>
                                                    <p className="save-btn" onClick={() => {
                                                        this.store.confirmInfo()
                                                    }}>保存</p>
                                                </div>
                                            </div>
                                        </div>
                                        <div className="personalInfo-wrapper">
                                            <div className="header-wrapper">
                                                <p className="title">版本记录</p>
                                            </div>
                                            <div className="version-record-content">
                                                <div className="content">
                                                    {
                                                        this.store.buyRecord && this.store.buyRecord.map((item, index) => {
                                                            return (
                                                                <div key={index} className="users-wrapper-pc">
                                                                    <div className="user-item-wrapper">
                                                                        <div className="content-date">
                                                                            <p className="text">
                                                                                <span>{$$.utils.getFormatAllTime2(item.createTime, true)}</span>
                                                                            </p>
                                                                        </div>
                                                                        <div className="content-version">
                                                                            <p className="text">
                                                                                <span>{item.name}</span>
                                                                            </p>
                                                                        </div>
                                                                        <div className="content-identity">
                                                                            <p className="text">
                                                                                <span>{item.time / 12}年</span>
                                                                            </p>
                                                                        </div>
                                                                        <div className="content-money">
                                                                            <p className="text">
                                                                                <span>{item.money / 100}元</span>
                                                                            </p>
                                                                        </div>
                                                                        <div className="content-from">
                                                                            <p className="text">
                                                                                <span>{item.payWay}</span>
                                                                            </p>
                                                                        </div>
                                                                        <div className="content-time">
                                                                            {
                                                                                !!item.payTime && !!item.endTime &&
                                                                                <p className="text">
                                                        <span className="time">
                                                        {$$.utils.timeToMonthDay(item.payTime, true)
                                                        + '至' + $$.utils.timeToMonthDay(item.endTime, true)}
                                                    </span>
                                                                                </p>
                                                                            }
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            )
                                                        })
                                                    }
                                                    <div className="manage-btn-wrapper">
                                                        <div className="add-btn"
                                                             onClick={(e) => this.store.addVersionRecord(e)}>添加版本
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {
                                            this.store.type === 2 &&
                                            <div className="personalInfo-wrapper">
                                                <div className="header-wrapper">
                                                    <p className="title">二维码</p>
                                                    {/*<p className="save-btn">保存</p>*/}
                                                </div>
                                                <div className="qrcode-content">
                                                    {
                                                        this.store.hasCode &&
                                                        <div className="content-left">
                                                            <div className="artist-code-content" id="content">
                                                                <div className="qr-code">
                                                                    <div className="code-image">
                                                                        <QRCode value={this.store.href + '&qrcode=1'}
                                                                                size={document.body.clientWidth > 840 ? 200 : document.body.clientWidth * 0.7}/>
                                                                    </div>
                                                                    <div className="logo-mask-wrapper">
                                                                        <div className="logo-wrapper" id="codeImg">
                                                                            <img src={this.store.logo} className="logo"
                                                                                 alt=""/>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    }

                                                    <div className="content-right">
                                                        <div className="choose-wrapper">
                                                            {
                                                                this.store.hasCode && this.store.codeList.map((item, index) => {
                                                                    let active = !!~this.store.productCode.indexOf(item.productCode);
                                                                    return (
                                                                        <div key={index} className="give-choose">
                                                                            <div
                                                                                onClick={() => this.store.itemClick(item, active)}
                                                                                className={active ? 'my-checkbox checked' : 'my-checkbox'}>
                                                                                <ReIcon icon="define"
                                                                                        className="my-checkbox-icon"/>
                                                                            </div>
                                                                            <p className="text">{item.productName}</p>
                                                                        </div>
                                                                    )
                                                                })
                                                            }
                                                        </div>
                                                        <div className="give-time">
                                                            <p className="title">赠送时长</p>
                                                            <ReTextField
                                                                label=""
                                                                isLabel={false}
                                                                type="number"
                                                                className="name-input"
                                                                // tipLeft={true}
                                                                CN={true}
                                                                maxLength="4"
                                                                notfullWidth={false}
                                                                closeIcon={true}
                                                                supportIntOnly={true}
                                                                onChange={(e, v) => this.store.productTimeChange(v)}
                                                                // errorText={this.store.nickNameError}
                                                                value={this.store.productTime}
                                                                placeholder={''}/>
                                                            <p className="title">月</p>
                                                            <p className="download-btn"
                                                               onClick={() => this.store.clickBtn()}>{this.store.hasCode ? '修改赠送时长' : '添加'}</p>
                                                        </div>
                                                        <div className="btn-wrapper">
                                                            {
                                                                this.store.hasCode &&
                                                                <p className="download-btn"
                                                                   onClick={() => this.store.savePicture()}>下载二维码</p>
                                                            }
                                                            {
                                                                this.store.hasCode &&
                                                                <p className="download-btn"
                                                                   onClick={() => this.store.deleteProductVersion()}>
                                                                    删除二维码</p>
                                                            }
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        }
                                        <div className="personalInfo-wrapper">
                                            <div className="header-wrapper">
                                                <p className="title">邀请</p>
                                                {/*<p className="save-btn">保存</p>*/}
                                            </div>
                                            <div className="invite-content">
                                                <div className="assign-agent-wrapper">
                                                    {/*<div className="name-input" onClick={(e, v) => this.store.authorNameFocus(v)}>{this.store.agentName}</div>*/}
                                                    <ReTextField
                                                        label=""
                                                        isLabel={false}
                                                        type="text"
                                                        className="name-input"
                                                        readOnly={true}
                                                        CN={true}
                                                        maxLength="20"
                                                        notfullWidth={false}
                                                        onFocus={(e, v) => this.store.authorNameFocus(v)}
                                                        value={this.store.agentName}
                                                        placeholder={''}/>
                                                    {
                                                        this.store.showSearchFlag &&
                                                        <div className="search-user-wrapper">
                                                            <div className="search-user-top">
                                                                <ReTextField
                                                                    isLabel={false}
                                                                    type="number"
                                                                    className="search-user-input"
                                                                    notfullWidth={false}
                                                                    onChange={(e, v) => this.store.searchPhoneOnChange(v)}
                                                                    value={this.store.searchPhone}
                                                                    closeIcon={true}
                                                                    closeHandler={() => this.store.closePhoneHandle()}
                                                                    onKeyDown={(e) => this.store.nameInput(e)}
                                                                    placeholder={'搜索手机号'}/>
                                                                <ReTextField
                                                                    isLabel={false}
                                                                    type="text"
                                                                    className="search-user-input"
                                                                    notfullWidth={false}
                                                                    onChange={(e, v) => this.store.searchNameOnChange(v)}
                                                                    value={this.store.searchName}
                                                                    closeIcon={true}
                                                                    closeHandler={() => this.store.closeNameHandle()}
                                                                    onKeyDown={(e) => this.store.nameInput(e)}
                                                                    placeholder={'搜索用户名'}/>
                                                                <span className="btn"
                                                                      onClick={() => this.store.search()}>搜索</span>
                                                                <span className="search-user-span"
                                                                      onClick={(e) => this.store.closeSearchWrapper(e)}>
                                                            <ReIcon icon="window_closes"/>
                                                        </span>
                                                            </div>
                                                            <div className="search-user-bottom">
                                                                <ul className="bottom-ul" ref="bottomUl">
                                                                    {
                                                                        this.store.agentList && this.store.agentList.map((item, index) => {
                                                                            return (
                                                                                <li key={index}
                                                                                    onClick={(e) => this.store.itemSearchClick(e, item)}
                                                                                    className="bottom-li">
                                                                                    <p className="li-name">
                                                                                        <span>{item.name}</span>
                                                                                    </p>
                                                                                    <p className="li-phone">{item.phone}</p>
                                                                                </li>
                                                                            )
                                                                        })
                                                                    }
                                                                </ul>
                                                            </div>
                                                        </div>
                                                    }
                                                </div>
                                                <p className="edit-btn" onClick={() => this.store.confirmAddAgent()}>
                                                    保存</p>
                                                <p className="edit-btn" onClick={() => this.store.deleteAgent()}>
                                                    删除</p>
                                            </div>
                                        </div>
                                    </div>
                                    :
                                    <div className="main-contain">
                                        <div className="personalInfo-wrapper">
                                            <div className="header-wrapper">
                                                <p className="title">添加用户</p>
                                            </div>
                                            <div className="personalInfo-content">
                                                <div className="user-info-detail">
                                                    <div className="user-info-top">
                                                        {/*<div className="user-info-avatar">*/}
                                                        {/*<ReAvatar*/}
                                                        {/*src={$$.utils.pictureThumb(this.store.cover, false)}*/}
                                                        {/*size={300}*/}
                                                        {/*className="avatar-image"/>*/}
                                                        {/*<p className="change-avatar-btn">*/}
                                                        {/*<span>{'添加头像'}</span>*/}
                                                        {/*<input type='file' ref="avatarFile"*/}
                                                        {/*onChange={(e) => this.store.filesOnChange(e, this.refs.avatarFile)}*/}
                                                        {/*accept="image/jpg,image/png,image/jpeg"/>*/}
                                                        {/*</p>*/}
                                                        {/*</div>*/}
                                                        <div className="user-info-right">
                                                            <div className="detail-form">
                                                                <div className="detail-item-wrapper">
                                                                    <div className="detail-item-line2">
                                                                        <span className="label">{'姓名'}</span>
                                                                        <ReTextField
                                                                            label=""
                                                                            isLabel={false}
                                                                            type="text"
                                                                            className="name-input"
                                                                            // tipLeft={true}
                                                                            CN={true}
                                                                            maxLength="20"
                                                                            notfullWidth={false}
                                                                            closeIcon={true}
                                                                            onChange={(e, v) => this.store.inputNickName(v)}
                                                                            onBlur={(e, v) => this.store.nickNameBlur()}
                                                                            // errorText={this.store.nickNameError}
                                                                            value={this.store.nickName}
                                                                            placeholder={$$.LN.NICK_NAME_HINT_TEXT}/>
                                                                    </div>
                                                                    <div className="detail-item-line2">
                                                                        <span className="label">{'类型'}</span>
                                                                        <ReSelectField
                                                                            type=""
                                                                            className="identity-input"
                                                                            isOpen={false}
                                                                            list={this.labelList}
                                                                            value={this.store.label}
                                                                            placeholder={'请选择类型'}
                                                                            onChange={(v) => this.store.identityChange(v.value, v.type)}/>

                                                                    </div>
                                                                </div>
                                                                <div className="detail-item-wrapper">
                                                                    <div className="detail-item-line2">
                                                                        <span className="label">手机号码</span>
                                                                        <CountryCodeSelect
                                                                            codeList={this.store.stores.Frame.countryCodeList}
                                                                            currentSelect={this.store.selectCountryCode}
                                                                            onChange={(item) => this.store.selectCodeItem(item)}/>
                                                                        <ReTextField
                                                                            label=""
                                                                            isLabel={false}
                                                                            type="number"
                                                                            className="phone-input"
                                                                            // tipLeft={true}
                                                                            CN={true}
                                                                            maxLength={this.store.selectCountryCode.code === $$.SEM.CN_COUNTRY_CODE || !this.store.selectCountryCode.code ? '11' : '15'}
                                                                            notfullWidth={false}
                                                                            supportIntOnly={true}
                                                                            errorText={'' ? 'error' : ''}
                                                                            onChange={(e, v) => this.store.phoneChange(v)}
                                                                            onBlur={(e, v) => this.store.mobileBlur()}
                                                                            value={this.store.phone}
                                                                            placeholder={'请输入手机号'}>
                                                                        </ReTextField>
                                                                    </div>
                                                                    <div className="detail-item-line2">
                                                                        <span className="label">密码</span>
                                                                        <ReTextField
                                                                            label=""
                                                                            isLabel={false}
                                                                            type="password"
                                                                            notfullWidth={false}
                                                                            className="form-input"
                                                                            onChange={(e, v) => {
                                                                                this.store.inputPassword(v)
                                                                            }}
                                                                            closeIcon={true}
                                                                            value={this.store.password}
                                                                            maxLength="15"
                                                                            onBlur={(e, v) => this.store.passwordBlur()}
                                                                            errorText={this.store.passwordError ? 'error' : ''}
                                                                            placeholder={'请输入密码'}>
                                                                        </ReTextField>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div className="form-err-text">
                                                                <ReInfoText type="error" text={this.store.errorText}/>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                            }
                            <div className="close-footer">
                                <p className="title" onClick={(e) => this.store.closeDialog(e)}>关闭</p>
                                {
                                    this.store.display !== 'edit' &&
                                    <p className="save-btn" onClick={() => {
                                        this.store.confirmInfo()
                                    }}>保存</p>
                                }
                            </div>
                        </div>
                    </div>
                </div>
                <div className={this.store.showDialog ? 'version-dialog show' : 'version-dialog hide'}>
                    <div className="addVersion-wrap" onClick={(e) => this.store.closeVersionDialog(e)}>
                        <div className="addVersion-box" onClick={(e) => e.stopPropagation()}>
                            <div className="version-title">
                                <p>{'添加版本'}</p>
                                <span className="close-btn" onClick={(e) => this.store.closeVersionDialog(e)}>
                                    <ReIcon icon="window_closes"/>
                                </span>
                            </div>
                            <div className="version-content">
                                <div className="detail-item-wrapper">
                                    <span className="label">{'选择版本'}</span>
                                    <ReSelectField
                                        type=""
                                        className="identity-input"
                                        isOpen={false}
                                        list={toJS(this.store.versionList)}
                                        value={this.store.versionId}
                                        placeholder={'请选择版本'}
                                        onChange={(v) => this.store.versionChoose(v.value)}/>
                                </div>
                            </div>
                            <div className="version-footer">
                                <ReButton
                                    onClick={(e) => this.store.confirmAddRecord(e)}
                                    className="confirm"
                                    label={'确定'}/>
                            </div>
                        </div>
                    </div>
                </div>
                <div className={this.store.showInviteDialog ? 'version-dialog show' : 'version-dialog hide'}>
                    <div className="addVersion-wrap" onClick={(e) => this.store.closeInviteDialog(e)}>
                        <div className="addVersion-box" onClick={(e) => e.stopPropagation()}>
                            <div className="version-title">
                                <p>{'添加代理商'}</p>
                                <span className="close-btn" onClick={(e) => this.store.closeInviteDialog(e)}>
                                    <ReIcon icon="window_closes"/>
                                </span>
                            </div>
                            <div className="version-content">
                                <div className="detail-item-wrapper">
                                    <span className="label">{'选择代理商'}</span>
                                    <ReSelectField
                                        type=""
                                        className="identity-input"
                                        isOpen={false}
                                        list={toJS(this.store.agentList)}
                                        value={this.store.agentId}
                                        placeholder={'请选择代理商'}
                                        onChange={(v) => this.store.agentChoose(v.value)}/>
                                </div>
                            </div>
                            <div className="version-footer">
                                <ReButton
                                    onClick={(e) => this.store.confirmAddAgent(e)}
                                    className="confirm"
                                    label={'确定'}/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        );
    }
}